#include "strdruk.h"

#ifdef __cplusplus
#include <cstring>
#include <cstdlib>
#include <cstdio>
#else
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#endif

#define SIZE 10

int main(void) {
  char sour[] = "Hello"; 
  char *dest;
    
  dest = (char*) malloc(sizeof *dest * (SIZE));
  drukPoZnaku(sour);
  
  // copy LESS chars than source
  strncpy(dest, sour, 1);
  
  fprintf(stdout, "After strncpy (char* strTo, const char* strFrom, size_t n)\n");
  drukPoZnaku(dest);
  
  // copy MORE chars than source
  strncpy(dest, sour, 8);
  
  fprintf(stdout, "After strncpy (char* strTo, const char* strFrom, size_t n)\n");
  drukPoZnaku(dest);
	
  free(dest);
}